package com.fm.financemanage.component;

import lombok.extern.slf4j.Slf4j;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Slf4j
@Component
public class TaskQuartzBean extends QuartzJobBean {
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        final JobDataMap jobDataMap =
                jobExecutionContext.getJobDetail().getJobDataMap();

        log.info("定时任务执行,time:{},map:{}", LocalDateTime.now().toString(),jobDataMap.keySet());


        final String type = jobDataMap.getString("type");

    }
}
